

import java.io.Serializable;

import edu.stanford.nlp.ling.TaggedWord;

/**
 * The Class TaggedWordExt.
 */
public class TaggedWordExt implements Serializable {
	
	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -1683808572293078735L;
	
	/** The t word. */
	private TaggedWord tWord;
	
	/**
	 * Instantiates a new tagged word ext.
	 * 
	 * @param word the word
	 */
	public TaggedWordExt(String word){
		this.tWord = new TaggedWord(word);
	}
	
	/**
	 * Instantiates a new tagged word ext.
	 * 
	 * @param tWord the t word
	 */
	public TaggedWordExt(TaggedWord tWord){
		this.tWord = tWord;
	}
	
	/**
	 * Gets the tag.
	 * 
	 * @return the tag
	 */
	public String getTag(){
		return tWord.tag();
	}
	
	/**
	 * Gets the word.
	 * 
	 * @return the word
	 */
	public String getWord(){
		return tWord.word();
	}
	
	/**
	 * Checks if is verb.
	 * 
	 * @return true, if is verb
	 */
	public boolean isVerb(){
		return tWord.tag().equals("VB") || tWord.tag().equals("VBD")
				|| tWord.tag().equals("VBP") || tWord.tag().equals("VBZ");
	}
	
	/**
	 * Checks if is adjective.
	 * 
	 * @return true, if is adjective
	 */
	public boolean isAdjective(){
		return tWord.tag().equals("JJ") || tWord.tag().equals("JJR") || tWord.tag().equals("JJS") 
				|| tWord.tag().equals("VBG") || tWord.tag().equals("VBN");
	}
	
	/**
	 * Checks if is adverb.
	 * 
	 * @return true, if is adverb
	 */
	public boolean isAdverb(){
		return tWord.tag().equals("RB") || tWord.tag().equals("RBR") || tWord.tag().equals("RBS");
	}
	
	/**
	 * Checks if is noun.
	 * 
	 * @return true, if is noun
	 */
	public boolean isNoun(){
		return tWord.tag().equals("NN") || tWord.tag().equals("NNS") || tWord.tag().equals("NNP") 
				|| tWord.tag().equals("NNPS") || tWord.tag().equals("PDT") || tWord.tag().equals("PRP");
	}
	
	/**
	 * Checks if is modal.
	 * 
	 * @return true, if is modal
	 */
	public boolean isModal(){
		return tWord.tag().equals("MD");
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString(){
		return tWord + "";
	}	
}
